import React, { Component } from 'react';

import {BrowserRouter,Route,Switch} from 'react-router-dom';
import Home from './views/Home.jsx';
import List from './views/List.jsx';
const list = [
    { path:'/list',page:List, exact: false},
    { path:'/',page:Home, exact: false}
]
import store from './redux/store/store.js';
import { Provider } from 'react-redux';
class App extends Component {
    render() {
        return (
            <Provider store={store} >
                <BrowserRouter>
                    <Switch>
                        {
                            list.map((v,i)=>{
                                return(
                                    <Route component={v.page} path={v.path} key={i} exact={v.exact} />
                                )
                            })
                        }
                    </Switch>
                </BrowserRouter>
            </Provider>
        );
    }
}

export default App;